package chp10;

public class Test1_Student {

    public static void main(String[] args) {
        /*
        * 学号    姓名  性别  年龄
        *  102    jack  boy   19
        *  105    tom   boy   20
        *  209    rose  girl  21
        * */

        //可以通过类来描述学生信息
        //先有类才能有对象
        //通过new Student() 才能创建一个学生的个体出来
        Student stu1 = new Student();
        Student stu2 = new Student();
        Student stu3 = new Student();

        stu1.id = 102;
        stu1.name = "jack";
        stu1.age = 19;
        stu1.gender = "boy";

        stu2.id = 105;
        stu2.name = "tom";
        stu2.age = 20;
        stu2.gender = "boy";

        stu3.id = 209;
        stu3.name = "rose";
        stu3.age = 21;
        stu3.gender = "girl";

        System.out.println("学号 姓名 年龄 性别");
        System.out.println(stu1.id+" "+ stu1.name+" "+stu1.age+" "+stu1.gender);
        System.out.println(stu2.id+" "+ stu2.name+" "+stu2.age+" "+stu2.gender);
        System.out.println(stu3.id+" "+ stu3.name+" "+stu3.age+" "+stu3.gender);
    }
}
